<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>{$webname.webname|default='xxx'}后台管理系统</title>
    <link rel="shortcut icon" href="/static/admin/img/logo.jpg" type="image/x-icon">
    <link href="/static/admin/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/static/admin/css/font-awesome.min.css" rel="stylesheet" />
    <link href="/static/admin/css/weather-icons.min.css" rel="stylesheet" />
    <link id="beyond-link" href="/static/admin/css/beyond.min.css" rel="stylesheet" type="text/css" />
</head>
<style>
    body{
        width: 100%;
        height:100%;
        font-family: 'Open Sans', sans-serif;
        background: #092756;
        background: -moz-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%),-moz-linear-gradient(top,  rgba(57,173,219,.25) 0%, rgba(42,60,87,.4) 100%), -moz-linear-gradient(-45deg,  #670d10 0%, #092756 100%);
        background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -webkit-linear-gradient(top,  rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -webkit-linear-gradient(-45deg,  #670d10 0%,#092756 100%);
        background: -o-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -o-linear-gradient(top,  rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -o-linear-gradient(-45deg,  #670d10 0%,#092756 100%);
        background: -ms-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), -ms-linear-gradient(top,  rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), -ms-linear-gradient(-45deg,  #670d10 0%,#092756 100%);
        background: -webkit-radial-gradient(0% 100%, ellipse cover, rgba(104,128,138,.4) 10%,rgba(138,114,76,0) 40%), linear-gradient(to bottom,  rgba(57,173,219,.25) 0%,rgba(42,60,87,.4) 100%), linear-gradient(135deg,  #670d10 0%,#092756 100%);
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3E1D6D', endColorstr='#092756',GradientType=1 );
    }
</style>
<body>
<div class="login-container">
    <div class="logobox">
        <p class="text-center" style="font-size: 18px;font-weight: bold;text-shadow: 3px 3px 3px #FF0000;font-style: italic;border-radius: 10px;">{$webname.webname|default='xxx'}后台管理系统</p>
    </div>
    <div style="height: 10px;"></div>
    <div class="loginbox bg-white">
        <div class="loginbox-title">忘记密码</div>
        <div class="loginbox-or">
            <div class="or-line"></div>
        </div>
        <form>
            <div class="loginbox-textbox">
                <input type="text" class="form-control" name="account" placeholder="账号" />
            </div>

            <div class="loginbox-textbox hidden">
                <input type="text" class="form-control" name="code" placeholder="验证码" />
            </div>

            <div class="loginbox-textbox hidden">
                <input type="password" class="form-control" name="npassword" placeholder="新密码" />
            </div>

            <div class="loginbox-textbox hidden">
                <input type="password" class="form-control" name="qpassword" placeholder="确认密码" />
            </div>

            <div class="loginbox-submit">
                <input type="submit" class="btn btn-primary btn-block" id="sendCode" value="获取验证码">
                <span style="color: #ff0000">验证码将发送至管理员注册时所填写的邮箱内(5分钟内有效!)</span>
            </div>
            <div class="loginbox-submit hidden">
                <input type="submit" class="btn btn-primary btn-block" id="reset"  value="修改密码">
            </div>
        </form>
        <div class="loginbox-signup">
            <a href="{:url('admin/index/login')}">返回登录</a>
        </div>
    </div>
</div>

{include file="public/_js" /}
<script>
    $(function () {
        $('#sendCode').click(function () {
            $.ajax({
                url:"{:url('admin/index/forget')}",
                type:'post',
                data:$('form').serialize(),
                dataType:'json',
                success:function(data){
                    if (data.code == 1){
                        layer.msg(data.msg,{
                            icon:6,
                            time:1000
                        },function () {
                            setTimeout(function () {
                                $('[name=account]').parent().addClass('hidden');
                                $('[name=code]').parent().removeClass('hidden');
                                $('[name=npassword]').parent().removeClass('hidden');
                                $('[name=qpassword]').parent().removeClass('hidden');
                                $('#sendCode').parent().addClass('hidden');
                                $('#reset').parent().removeClass('hidden');
                            },1000);
                        });
                    } else {
                        layer.open({
                            title:'发送失败！',
                            content:data.msg,
                            icon:5,
                            anim:6
                        });
                    }
                }
            });
            return false;
        });


        $('#reset').click(function () {
            $.ajax({
                url:"{:url('admin/index/setpass')}",
                type:'post',
                data:$('form').serialize(),
                dataType:'json',
                success:function (data) {
                    if (data.code == 1){
                        layer.msg(data.msg,{
                            icon:6,
                            time:1000
                        },function () {
                            location.href = data.url;
                        });
                    } else {
                        layer.open({
                            title:'编辑状态',
                            content:data.msg,
                            icon:5,
                            anim:6
                        });
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
<!--  /Body -->
</html>
